const {
  override,
  fixBabelImports,
  addLessLoader,
  addWebpackAlias
} = require("customize-cra");
const path = require("path");

module.exports = override(
  fixBabelImports("import", {
    libraryName: "antd",
    libraryDirectory: "es",
    style: "css",
    style: true
  }),
  addLessLoader({
    javascriptEnabled: true,
    modifyVars: {
      "primary-color": "#00b0ff",
      "link-color": "#1890ff" // 链接色
    }
  }),
  addWebpackAlias({
    ["mocks"]: path.resolve(__dirname, "src/mock"),
    ["assets"]: path.resolve(__dirname, "src/assets"),
    ["stores"]: path.resolve(__dirname, "src/stores"),
    ["utils"]: path.resolve(__dirname, "src/utils"),
    ["components"]: path.resolve(__dirname, "src/components"),
    ["src"]: path.resolve(__dirname, "src")
  })
);
